package fudan.se.project.repository.entity.conference;

import fudan.se.project.domain.conference.Topic;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TopicRepository extends CrudRepository<Topic, Long> {

    Topic findById(long id);

    @Query("select distinct topic from Topic topic where topic.conference.id=:conferenceId ")
    List<Topic> findTopicsByConferenceId(long conferenceId);

}
